<script>
var default_lat = <?php echo $default_lat; ?>;
var default_lng = <?php echo $default_lng; ?>;
var default_mapzoom_mapType = "<?php echo $default_mapzoom_mapType; ?>";
var default_mapgadget_mapType = "<?php echo $default_mapgadget_mapType; ?>";
var default_map_mapType = "<?php echo $default_map_mapType; ?>";
var default_omap_mapType = "<?php echo $default_omap_mapType; ?>";
var langue = '<?php echo $langue; ?>';
var lang_destination_name = '<?php echo $lang_destination_name; ?>';
var lang_destination_lat = '<?php echo $lang_destination_lat; ?>';
var lang_destination_long = '<?php echo $lang_destination_long; ?>';
var lang_destination_url = '<?php echo $lang_destination_url; ?>';
var lang_destination_trips = '<?php echo $lang_destination_trips; ?>';
var lang_destination_photourl = '<?php echo $lang_destination_photourl; ?>';
var lang_trips_show_link = '<?php echo $lang_trips_show_link; ?>';
var lang_trips_title = '<?php echo $lang_trips_title; ?>';
var lang_show_world_link = '<?php echo $lang_show_world_link; ?>';
var lang_world_link = '<?php echo $lang_world_link; ?>';
var lang_show_latest_link = '<?php echo $lang_show_latest_link; ?>';
var lang_latest_link = '<?php echo $lang_latest_link; ?>';
var lang_show_visitor_link = '<?php echo $lang_show_visitor_link; ?>';
var lang_visitor_link = '<?php echo $lang_visitor_link; ?>';
var lang_linktothis = '<?php echo $lang_linktothis; ?>';
var lang_linktothistitle = '<?php echo $lang_linktothistitle; ?>';
var lang_googlemapstitle = '<?php echo $lang_googlemapstitle; ?>';
var lang_linkplacetitle = '<?php echo $lang_linkplacetitle; ?>';
var lang_linkalbumtitle = '<?php echo $lang_linkalbumtitle; ?>';
var lang_export_kml_link = '<?php echo $lang_export_kml_link; ?>';
var lang_add_place_link = '<?php echo $lang_add_place_link; ?>';
var lang_edit_place_link = '<?php echo $lang_edit_place_link; ?>';
var lang_zoomin = '<?php echo $lang_zoomin; ?>';
var moreinfoNames = [];
var moreinfoNamesLabel = [];
<?php
include_once("config.php");

foreach($moreinfoNames as $name) {
   echo 'moreinfoNames.push("'.$name.'");';
   echo 'moreinfoNamesLabel["'.$name.'"] = "'.$moreinfoNamesLabel[$name].'";';
}
?>
var extramapsParams = [];
<?php
foreach($extramapsParams as $name => $value) {
   echo 'extramapsParams["'.$name.'"] = "'.$value.'";';
}
?>

function getCategories() {
	var result = "";
	var tcolor = "";
	if(currentFile == "") {
		tcolor = " style='background-color:lightgreen' ";
	}
	result += "<a href='javascript:void(0);' id='f_' "+tcolor+" class='menuItem' title='<?php echo $lang_reload_trips_link; ?>' onclick='callTrips(\"\");' ><?php echo $lang_trips_title; ?></a>"+" ";
<?php foreach ($extramaps as $map) { ?>
	tcolor = "";
	if(currentFile == "<? echo $map; ?>") {
		tcolor = " style='background-color:lightgreen' ";
	}
	result += "<a href='javascript:void(0);' id='f_<?php echo $map; ?>' "+tcolor+" class='menuItem' title='<?php echo $extramapsNames[$map]; ?>' onclick='callTrips(\"<?php echo $map; ?>\")' ><?php echo $extramapsNames[$map]; ?></a>"+" ";
<?  } ?>
    return result;
}


function getPlacesTools(hideEditTools) {
	var result = "";
  	result += "<a href='javascript:void(0);' class='menuItem' onclick='showAllPoints(mapzoom, bounds);' title='<?php echo $lang_allmap_link; ?>' ><img src='images/polyline.gif' alt='<?php echo $lang_allmap_link; ?>' /> <?php echo $lang_allmap_link; ?></a>"+" ";
	result += '<a href="javascript:void(0);" class="menuItem" onclick="exportToKml();" title="<?php echo $lang_export_kml_link; ?>" ><img src="images/google_earth_link.gif" width="18px" alt="<?php echo $lang_export_kml_link; ?>" /> <?php echo $lang_export_kml_link; ?></a>'+' ';

	result += "<a href='index.php?showfile="+escape(currentFile)+"&showtrip="+currentTrip+"' class='menuItem'  title='"+lang_linktothistitle+"'><img src='images/link.gif' alt='"+lang_linktothistitle+"' /> "+lang_linktothis+"</a>"+" ";

	if (!hideEditTools) {
		result += '<a id="editcurrenttriplink" class="menuItem" href="javascript:void(0);" onclick="editCurrentTrip();" title="<?php echo $lang_edittrip_link; ?>" ><img src="images/edit.gif" alt="<?php echo $lang_edittrip_link; ?>" /> <?php echo $lang_edittrip_link; ?></a>'+' ';
	}
    return result;
}
</script>